home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 004a / mathpl20.zip / MATHPLOT.DOC next >
Text File  |  1991-12-27  |  42KB  |  1,015 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                   M A T H P L O T
  10.  
  11.  
  12.  
  13.                       Mathematical Function Plotting Program
  14.  
  15.  
  16.  
  17.                                 Phillip H. Sherrod
  18.  
  19.                               A "shareware" program.
  20.                              Copyright (c) 1991, 1992.
  21.                                All rights reserved.
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.               MATHPLOT allows you to specify complicated mathematical
  29.               functions  using  ordinary  algebraic  expressions  and
  30.               immediately plot them.  Four types of functions may  be
  31.               specified:  cartesian  (Y=f(X));  parametric  cartesian
  32.               (Y=f(T)  and  X=f(T));  polar  (Radius=f(Angle));   and
  33.               parametric polar  (Radius=f(T)  and Angle=f(T)).  Up to
  34.               four functions may be plotted simultaneously.   Scaling
  35.               is automatic.    Options  are available to control axis
  36.               display and labeling as well as grid lines.  Hard  copy
  37.               output  may  be  generated  as  well as screen display.
  38.               MATHPLOT is an ideal tool  for  engineers,  scientists,
  39.               math and science teachers, and anyone else who needs to
  40.               quickly visualize mathematical functions.
  41.  
  42.                MATHPLOT -- Mathematical Function Plotter      Page 1
  43.  
  44.  
  45.  
  46.  
  47.          INTRODUCTION
  48.  
  49.          MATHPLOT  is  a  program  for  IBM-PC  computers   which   allows
  50.          interactive entry  and  plotting of mathematical functions.  Some
  51.          of the features of MATHPLOT are listed below:
  52.  
  53.               Direct  entry  of  complicated  mathematical  functions
  54.               using   normal   algebraic  expressions  with  embedded
  55.               operators and functions.
  56.  
  57.               An   assortment   of   built-in   functions   including
  58.               trigonometric,   square  root,  Gamma,  Bessel,  normal
  59.               probability distribution, log, etc.
  60.  
  61.               The ability to plot four types of functions:  cartesian
  62.               (Y=f(X));  parametric  cartesian  (Y=f(T)  and X=f(T));
  63.               polar   (Radius=f(Angle));   and    parametric    polar
  64.               (Radius=f(T) and Angle=f(T)).
  65.  
  66.               The   ability   to   simultaneously  plot  up  to  four
  67.               functions.
  68.  
  69.               Automatic scaling and axis labeling.
  70.  
  71.               The ability to save function specifications in  command
  72.               files which then can be easily executed.
  73.  
  74.               The  ability to accept X-Y data points from an external
  75.               file.
  76.  
  77.               Printed copies of plots may be produced on HP  LaserJet
  78.               printers.
  79.  
  80.                MATHPLOT -- Mathematical Function Plotter      Page 2
  81.  
  82.  
  83.          INSTALLING MATHPLOT
  84.  
  85.          The MATHPLOT system consists of the following files:
  86.  
  87.          MATHPLOT.EXE -- The executable program.
  88.          MATHPLOT.HLP -- Text file accessed by HELP command.
  89.          MATHPLOT.FON -- Font file used for title line and axis labels.
  90.          MATHPLOT.LJF -- Font file for HP LaserJet printer.
  91.          MATHPLOT.FUN -- Example functions
  92.          MATHPLOT.DOC -- Documentation file.
  93.  
  94.          To install MATHPLOT, copy the files into the  directory  of  your
  95.          choice.   If  you do not plan to generated hard copy output for a
  96.          LaserJet printer, you may delete the MATHPLOT.LJF file.   If  the
  97.          MATHPLOT.HLP,  MATHPLOT.FON,  and  MATHPLOT.LJF  files are not in
  98.          your current directory, you must place a command of the following
  99.          form in your AUTOEXEC.BAT file to tell MATHPLOT where to look for
  100.          its help and font files:
  101.  
  102.          SET MATHPLOT=directory
  103.  
  104.          Where "directory" is the name of the device and  directory  where
  105.          the files  are located.  For example, if the files are located in
  106.          a directory named MATHPLOT on the C disk, the  following  command
  107.          could be used:
  108.  
  109.          SET MATHPLOT=C:\MATHPLOT
  110.  
  111.  
  112.  
  113.          GETTING STARTED
  114.  
  115.          MATHPLOT is exceptionally easy to use.  Although there are a fair
  116.          number  of  commands  to control options, you only need to know a
  117.          couple of commands to begin using it.
  118.  
  119.          Start the program by entering the command:
  120.  
  121.          MATHPLOT
  122.  
  123.          MATHPLOT will display a title screen; press Enter to  proceed  to
  124.          command mode.    MATHPLOT  prints  a  greater-than  sign (">") to
  125.          prompt you for a command.  Begin by specifying a simple  function
  126.          to be plotted.  I suggest you enter the command:
  127.  
  128.                MATHPLOT -- Mathematical Function Plotter      Page 3
  129.  
  130.  
  131.          Y=SIN(X)
  132.  
  133.          You may use either upper or lower case letters when  you  type  a
  134.          command.   Next,  command  MATHPLOT to evaluate this function and
  135.          plot the results by entering the command:
  136.  
  137.          PLOT
  138.  
  139.          You should see a sine wave displayed on your screen.  Press Enter
  140.          to return to command mode.  Now let's make the function  slightly
  141.          more complicated by entering the command:
  142.  
  143.          Y=SIN(X)+SIN(3*X)/3
  144.  
  145.          Enter the  PLOT  command again to see this function plotted.  Now
  146.          enter the  following  command  to  cause  numeric  labels  to  be
  147.          displayed on the axes:
  148.  
  149.          LABELS ON
  150.  
  151.          Now issue the PLOT command to see the results.
  152.  
  153.          So  far,  the  function  has  been  evaluated  over  the interval
  154.          (0,2*pi), which is the initial default domain.  Use the following
  155.          command to change the domain to (-2*pi,2*pi):
  156.  
  157.          DOMAIN -2*PI,2*PI
  158.  
  159.          Also, use the following command to turn on grid line display:
  160.  
  161.          GRID ON
  162.  
  163.          Now use the PLOT command to display  the  result.    As  a  final
  164.          exercise,  use  the following command to define a second function
  165.          to be displayed simultaneously with the first one:
  166.  
  167.          Y2=SIN(X)
  168.  
  169.          And, again use the PLOT command to display them.  You should  see
  170.          a simple sine wave (the Y2 function) superimposed on the previous
  171.          function (the Y function).  Use the EXIT command to exit MATHPLOT
  172.          and return to DOS.
  173.  
  174.                MATHPLOT -- Mathematical Function Plotter      Page 4
  175.  
  176.  
  177.          Demonstration Command File
  178.  
  179.          The  MATHPLOT  distribution  includes  a   command   file   named
  180.          MATHPLOT.FUN  containing  a  number of interesting example plots.
  181.          You can execute this command file  by  using  the  MATHPLOT  "DO"
  182.          command,  or  by  specifying  the  command file on the invocation
  183.          line.  The following DOS command starts the MATHPLOT program  and
  184.          instructs   it  to  execute  the  commands  stored  in  the  file
  185.          MATHPLOT.FUN:
  186.  
  187.          MATHPLOT MATHPLOT.FUN
  188.  
  189.               MATHPLOT -- Mathematical Function Plotter      Page 5
  190.  
  191.  
  192.          FUNCTION SPECIFICATION
  193.  
  194.          Much  of the power of MATHPLOT comes from its ability to evaluate
  195.          complicated functions entered in ordinary algebraic form.    This
  196.          section  explains the arithmetic operators and built in functions
  197.          that are used to define a function.
  198.  
  199.          Arithmetic Operators
  200.  
  201.          The following arithmetic operators may be used in expressions:
  202.  
  203.              +        addition
  204.              -        subtraction or unary minus
  205.              *        multiplication
  206.              /        division
  207.              ** or ^  exponentiation
  208.  
  209.          Exponentiation  has   the   highest   precedence,   followed   by
  210.          multiplication  and  division, and then addition and subtraction.
  211.          Parentheses may be used to group terms.
  212.  
  213.          As a convenience, MATHPLOT allows you to omit the  multiplication
  214.          operator  between  a numeric constant and a following variable or
  215.          function.  For example, the expressions  "2pi",  and  "2 pi"  are
  216.          equivalent to  "2*pi".    Similarly, "5X" is equivalent to "5*X".
  217.          However, if you specify a number before the letter "E",  it  will
  218.          be  taken  as the exponential form of a number (see below) rather
  219.          than  the  number  times  the  constant  E   (base   of   natural
  220.          logarithms).
  221.  
  222.          Numeric Constants
  223.  
  224.          Numeric  constants  may  be  written in their natural form (1, 0,
  225.          1.5, .0003, etc.) or in exponential form, n.nnnEppp, where  n.nnn
  226.          is  the  base value and ppp is the power of ten by which the base
  227.          is multiplied.  For example, the number 1.5E4  is  equivalent  to
  228.          15000.   All  numbers  are  treated  as  "floating point" values,
  229.          regardless of whether a decimal point is specified or not.
  230.  
  231.          Symbolic Constants
  232.  
  233.          There are two numeric  constants  that  may  be  specified  using
  234.          symbolic names.    The  symbolic  name  "PI" is equivalent to the
  235.          value of pi, 3.14159...  Similarly, the symbolic constant "E"  is
  236.          equivalent to the base of natural logarithms, 2.7182818...
  237.  
  238.                MATHPLOT -- Mathematical Function Plotter      Page 6
  239.  
  240.  
  241.  
  242.  
  243.          Parameter values
  244.  
  245.          MATHPLOT allows you to use parameters named P0, P1,  ...,  P9  in
  246.          function definitions.     You  can  then  assign  values  to  the
  247.          parameters and replot the function without having to  retype  the
  248.          function to  change  a  value.  To assign a value to a parameter,
  249.          type the parameter name as a command followed by the value to  be
  250.          assigned.   For  example, the following command assigns the value
  251.          0.67 to the parameter P0:
  252.  
  253.          P0 0.67
  254.  
  255.          Note that parameters are like constants during the evaluation and
  256.          plotting of a function (i.e., their values do not change).    But
  257.          you can assign new values to parameters between plot generations.
  258.          For  example,  consider  the  following  commands  which define a
  259.          function and then plot it twice with two different values of  the
  260.          P0 parameter:
  261.  
  262.          Y = EXP(-P0*X) * COS(X)
  263.          P0  0.6
  264.          PLOT
  265.          P0  0.8
  266.          PLOT
  267.  
  268.          This function represents the response of a damped oscillator with
  269.          the P0  coefficient  controlling the damping factor.  By changing
  270.          the value of the P0 parameter you can examine different forms  of
  271.          the function without having to retype the function.
  272.  
  273.  
  274.          Built in Functions
  275.  
  276.          The  following  functions are built into MATHPLOT and may be used
  277.          in expressions:
  278.  
  279.          ABS(x) -- Absolute value of x.
  280.  
  281.          ACOS(x) -- Arc cosine of x.  Angles are measured in radians.
  282.  
  283.          ASIN(x) -- Arc sine of x.  Angles are measured in radians.
  284.  
  285.               MATHPLOT -- Mathematical Function Plotter      Page 7
  286.  
  287.  
  288.          ATAN(x) -- Arc tangent of x.  Angles are measured in radians.
  289.  
  290.          J0(x) -- Bessel function of the first kind, order zero.
  291.  
  292.          J1(x) -- Bessel function of the first kind, order one.
  293.  
  294.          JN(n,x) -- Bessel function of the first kind, order n.
  295.  
  296.          COS(x) -- Cosine of x.  Angles are measured in radians.
  297.  
  298.          COSH(x) -- Hyperbolic cosine of x.
  299.  
  300.          COT(x) -- Cotangent of x. (COT(x) = 1/TAN(x)).
  301.  
  302.          CSC(X) -- Cosecant of x. (CSC(x) = 1/SIN(x)).
  303.  
  304.          DEG(x)  --  Converts  an  angle,  x,  measured  in radians to the
  305.                    equivalent number of degrees.
  306.  
  307.          EXP(x) -- e (base of natural logarithms) raised to the x power.
  308.  
  309.          FAC(x) -- x factorial (x!).  Note, the FAC function  is  computed
  310.                    using   the   GAMMA   function  (FAC(x)=GAMMA(x+1))  so
  311.                    non-integer argument values may be computed.
  312.  
  313.          GAMMA(x) -- Gamma function.  Note, GAMMA(x+1) = x! (x factorial).
  314.  
  315.          GAMMAI(x)  --  Reciprocal  of   GAMMA   function   (GAMMAI(x)   =
  316.                    1/GAMMA(x)).
  317.  
  318.          HAV(x) -- Haversine of x. (HAV(x) = (1-COS(x))/2).
  319.  
  320.          LOG(x) -- Natural logarithm of x.
  321.  
  322.          LOG10(x) -- Base 10 logarithm of x.
  323.  
  324.          MAX(x1,x2) -- Maximum value of x1 or x2.
  325.  
  326.          MIN(x1,x2) -- Minimum value of x1 or x2.
  327.  
  328.          NORMAL(x) -- Normal probability distribution of x.  X is in units
  329.                    of standard deviations from the mean.
  330.  
  331.                MATHPLOT -- Mathematical Function Plotter      Page 8
  332.  
  333.  
  334.          PULSE(a,x,b) -- Pulse function.  If the value of x is less than a
  335.                    or greater than b, the value of the function is 0.   If
  336.                    x  is greater than or equal to a and less than or equal
  337.                    to b, the value of the function is 1.  In other  words,
  338.                    it is  1  for  the domain (a,b) and zero elsewhere.  If
  339.                    you need a function that is zero in  the  domain  (a,b)
  340.                    and 1 elsewhere, use the expression (1-PULSE(a,x,b)).
  341.  
  342.          RAD(x) -- Converts an angle measured in degrees to the equivalent
  343.                    number of radians.
  344.  
  345.          SEC(x) -- Secant of x. (SEC(x) = 1/COS(x)).
  346.  
  347.          SIN(x) -- Sine of x.  Angles are measured in radians.
  348.  
  349.          SINH(x) -- Hyperbolic sine of x.
  350.  
  351.          SQRT(x) -- Square root of x.
  352.  
  353.          STEP(a,x) --  Step  function.   If x is less than a, the value of
  354.                    the function is 0.  If x is greater than or equal to a,
  355.                    the value of the function is 1.  If you need a function
  356.                    which is 1 up to a certain value and then 0 beyond that
  357.                    value, use the expression STEP(x,a).
  358.  
  359.          T(n,x) -- Chebyshev polynomial of order n.
  360.  
  361.          TAN(x) -- Tangent of x.  Angles are measured in radians.
  362.  
  363.          TANH(x) -- Hyperbolic tangent of x.
  364.  
  365.          Y0(x) -- Bessel function of the second kind, order zero.
  366.  
  367.          Y1(x) -- Bessel function of the second kind, order one.
  368.  
  369.          YN(n,x) -- Bessel function of the second kind, order n.
  370.  
  371.               MATHPLOT -- Mathematical Function Plotter      Page 9
  372.  
  373.  
  374.          FUNCTION TYPES
  375.  
  376.          MATHPLOT  allows four different types of functions to be plotted:
  377.          cartesian, parametric cartesian,  polar,  and  parametric  polar.
  378.          Each of the function types is described below:
  379.  
  380.          Cartesian Functions
  381.  
  382.          A  cartesian  function  has  the  form  Y=f(X),  where  X  is the
  383.          independent variable that is plotted along  the  horizontal  axis
  384.          and  Y  is  the  dependent variable plotted on the vertical axis.
  385.          The value specified with the DOMAIN command controls the interval
  386.          of X values over which the function is evaluated.  Some  examples
  387.          of this type of function are listed below:
  388.  
  389.          Y=SIN(X)
  390.          Y=2*X**2-3*X+5
  391.          Y=SIN(X)/EXP(X)
  392.          Y=1/SQRT(2*(X+1))
  393.  
  394.          Parametric Cartesian Functions
  395.  
  396.          Parametric  functions use a third variable, which we will call T,
  397.          as the  independent  variable.    Both  X  and  Y  are  dependent
  398.          variables  defined as functions of T. The value of the T variable
  399.          is not directly displayed on the plot but is  used  only  in  the
  400.          functions  that  define  the values of the X and Y variables that
  401.          are plotted.  For example, the following commands define X and  Y
  402.          as functions of T:
  403.  
  404.          X=COS(T)
  405.          Y=SIN(T)
  406.  
  407.          When  parametric  functions  are  defined,  the  DOMAIN statement
  408.          specifies the interval over which the T variable is computed.  If
  409.          the two functions of X and Y specified above are plotted over the
  410.          domain (0,2*PI), the result is a circle with  radius  1  centered
  411.          around the origin.
  412.  
  413.          Polar Functions
  414.  
  415.          A  polar  function  specifies the distance (or radius) of a point
  416.          from the origin as a function  of  the  angle  swept  around  the
  417.          origin.  The angle (A) is the independent variable and the radius
  418.          (R) is  the  dependent  variable.  The DOMAIN statement specifies
  419.  
  420.                MATHPLOT -- Mathematical Function Plotter     Page 10
  421.  
  422.  
  423.          the interval of values that the angle is to  be  evaluated  over.
  424.          The angle begins on the positive  X  axis;  positive  angles  are
  425.          measured counterclockwise around the origin.  Angles are measured
  426.          in  radians;  the  RAD  and  DEG functions can be used to convert
  427.          between degrees and radians.  The simplest polar function is
  428.  
  429.          R=1
  430.  
  431.          which specifies that for all angles the radius is  1.    If  this
  432.          function  is  plotted  over  the  domain (0,2*pi) the result is a
  433.          circle of radius 1 centered around the origin.    Another  simple
  434.          polar function is
  435.  
  436.          R=A
  437.  
  438.          which defines a spiral with the radius increasing with the angle.
  439.  
  440.          Parametric Polar Functions
  441.  
  442.          A  parametric polar function defines the radius (R) and angle (A)
  443.          as functions of the parametric variable, T. The DOMAIN  statement
  444.          defines  the  interval  of  T  values  over which the function is
  445.          evaluated.  The following is an example  of  a  parametric  polar
  446.          function definition:
  447.  
  448.          R=COS(T)
  449.          A=SIN(T)
  450.  
  451.          Over the domain (0,2*pi), this produces a figure-eight pattern.
  452.  
  453.  
  454.          PLOTTING SIMULTANEOUS FUNCTIONS
  455.  
  456.          Up to  four  functions  may  be  plotted  at the same time.  When
  457.          defining multiple functions, add a  single-digit  suffix  to  the
  458.          dependent variable  name  for  the  function.    For example, the
  459.          following  commands  define  four   functions   to   be   plotted
  460.          simultaneously:
  461.  
  462.          Y1=SIN(X)
  463.          Y2=COS(X)
  464.          Y3=SIN(2*X)
  465.          Y4=COS(2*X)
  466.  
  467.               MATHPLOT -- Mathematical Function Plotter     Page 11
  468.  
  469.  
  470.          If no  number  is  specified,  the default value is 1.  Thus, the
  471.          following two function definitions are equivalent:
  472.  
  473.          Y=2*X**2
  474.          Y1=2*X**2
  475.  
  476.          You can remove a function definition by defining another function
  477.          for  the  same  dependent variable or by specifying the dependent
  478.          variable without a function.  For example, the following  command
  479.          removes the definition for Y2:
  480.  
  481.          Y2
  482.  
  483.          When a function of a type (cartesian, polar, etc.) different from
  484.          the  current  type  is  defined,  all  of  the  currently defined
  485.          functions are removed.
  486.  
  487.               MATHPLOT -- Mathematical Function Plotter     Page 12
  488.  
  489.  
  490.          MATHPLOT COMMANDS
  491.  
  492.          The  commands  described  in  this  section  are  used to control
  493.          MATHPLOT. When MATHPLOT is waiting for a command, it  displays  a
  494.          greater-than sign  (">")  as  a  prompt.    If you need to type a
  495.          command that is longer than a single line,  you  may  continue  a
  496.          command  by typing a minus sign as the last character on the line
  497.          to be continued.  When MATHPLOT detects a minus sign as the  last
  498.          character  of  a  line,  it  deletes  the minus sign and requests
  499.          additional command input using the prompt "->".
  500.  
  501.          Commands may be abbreviated to the first three letters  of  their
  502.          keyword.   Commands  may  be  typed  using  upper  or  lower case
  503.          letters.
  504.  
  505.          You may place comments on commands by preceding the comment by an
  506.          exclamation point.  For  example,  the  following  commands  have
  507.          comments:
  508.  
  509.          ! Define square wave function
  510.          Y=SIN(X)+SIN(3*X)/3       ! Approximate square wave
  511.          DOMAIN 0,2*PI              ! One cycle of the function
  512.  
  513.          Startup Command File
  514.  
  515.          The DOS command to start MATHPLOT is:
  516.  
  517.          MATHPLOT [filename]
  518.  
  519.          where  "filename" is an optional parameter specifying the name of
  520.          a file containing commands to be executed by MATHPLOT as soon  as
  521.          it is started.  This startup command file may contain commands to
  522.          set  preferred  default  values,  or  it  may contain one or more
  523.          complete sets of statements to define functions  and  plot  them.
  524.          The default  file extension is ".FUN".  See also the descriptions
  525.          of the DO and SAVE  commands  for  additional  information  about
  526.          command files.
  527.  
  528.          Initialization file
  529.  
  530.          Each  time  Mathplot  is started it attempts to open a file named
  531.          MATHPLOT.INI. If  this  file  exists,  all  commands  in  it  are
  532.          executed.   You  may create such a file to contain initialization
  533.          commands to set default values.  For  example,  if  you  normally
  534.          like  to  have  axis  labeling and grid lines turned on, create a
  535.  
  536.                MATHPLOT -- Mathematical Function Plotter     Page 13
  537.  
  538.  
  539.          file named MATHPLOT.INI containing the  commands  "LABEL ON"  and
  540.          "GRID ON".  Mathplot looks for this file  first  in  the  current
  541.          directory  and if it does not find it there it checks to see if a
  542.          MATHPLOT environment variable  has  been  defined  to  specify  a
  543.          directory.   The  initialization file is executed before any file
  544.          specified on the command that starts Mathplot.
  545.  
  546.          Command Arguments
  547.  
  548.          Many of  the  commands  accept  numeric  arguments.      In   the
  549.          descriptions  below,  the  notation  "cexpr"  is shown wherever a
  550.          numeric argument may be specified.  These numeric  arguments  may
  551.          consist  of  numbers,  symbolic  constants, and expressions using
  552.          operators and built in functions.  For example, the following  is
  553.          a valid DOMAIN command:
  554.  
  555.          DOMAIN -2*PI,PI*SQRT(2)
  556.  
  557.          The  argument expressions may NOT contain variables such as X, Y,
  558.          R, A, or T, or parameters such as P0 or P1.
  559.  
  560.          Arguments shown in brackets are optional.  Braces around a set of
  561.          options indicate that you must choose one of the options  in  the
  562.          set.
  563.  
  564.          ALPHABETICAL LIST OF COMMANDS
  565.  
  566.          AXES {ON | OFF} (default=ON) -- Specifies whether to display axes
  567.                  without labels.    Use the LABELS command to display axes
  568.                  with labels.
  569.  
  570.          CALCULATE cexpr -- Evaluate the specified expression, which  must
  571.                  contain  only numbers, operators, and built in functions,
  572.                  and print the result.
  573.  
  574.          CAXES cexpr (default=3) -- Specify the color to be used  for  the
  575.                  axis lines and labels.
  576.  
  577.          CFn cexpr  (default=2,1,4,3)  -- Define the color to be used when
  578.                  plotting function 'n'.  For example, the command  "CF1 3"
  579.                  specifies  that  color  3  is  to  be  used when plotting
  580.                  function 1.
  581.  
  582.                MATHPLOT -- Mathematical Function Plotter     Page 14
  583.  
  584.  
  585.          CGRID cexpr (default=8) -- Specify the color to be used for  grid
  586.                  lines.
  587.  
  588.          CLEAR -- Clear the screen.
  589.  
  590.          COMMONSCALE {ON | OFF} (default=OFF) -- If this option is  turned
  591.                  on,  the  X  and Y directions are forced to have the same
  592.                  scale.  If this option is off, the X  and  Y  ranges  are
  593.                  scaled  independently,  which  may  cause  figures  to be
  594.                  distorted - for example,  a  circle  may  display  as  an
  595.                  ellipse.   However,  turning this option on may result in
  596.                  one of the dimensions using only a small portion  of  the
  597.                  screen if  the  X  and Y ranges are very different.  This
  598.                  option is always on for polar function plots.
  599.  
  600.          CTITLE cexpr (default=7) -- Specify the  color  to  use  for  the
  601.                  title line.
  602.  
  603.          DATA filename  --  Causes  X and Y data values to be read from an
  604.                  external file rather  than  being  computed  as  function
  605.                  definitions.   After the data has been read, use the PLOT
  606.                  command to display it.  Any function definition following
  607.                  this command will clear  the  external  data  values  and
  608.                  revert to  function  mode.    Each  X,Y data pair must be
  609.                  specified as a separate line in the  file  with  a  space
  610.                  separating the  X  value  from  the Y value.  The default
  611.                  extension for the file is ".DAT".
  612.  
  613.          DISPLAY string -- Display  the  string  on  the  console.    This
  614.                  command   may   be   placed  in  command  file  to  cause
  615.                  information to be printed while the command file is being
  616.                  processed.
  617.  
  618.          DO filename  --  Execute  the  MATHPLOT  commands  stored  in  an
  619.                  external file.    This  allows  you to specify a complete
  620.                  plot request, including functions and options,  and  then
  621.                  execute it  without  having  to  retype the commands.  An
  622.                  external file may itself contain a DO  command  and  this
  623.                  nesting may  be  performed  to  a depth of 10 files.  The
  624.                  default file  extension  is  ".FUN".     See   also   the
  625.                  description of the SAVE command.
  626.  
  627.                MATHPLOT -- Mathematical Function Plotter     Page 15
  628.  
  629.  
  630.          DOMAIN cexpr1,cexpr2 (default=0,2*pi) -- Define the domain of the
  631.                  independent  variable  over  which  the   functions   are
  632.                  evaluated and  plotted.    The  lower  end  of the domain
  633.                  (cexpr1) must be less than the upper end (cexpr2).   This
  634.                  command may be abbreviated to "DOM".
  635.  
  636.          EXIT -- Stop MATHPLOT and return to DOS.
  637.  
  638.          GRID {ON | OFF}  (default=OFF)  -- Specify whether grid lines are
  639.                  to be displayed.
  640.  
  641.          HELP -- Display several pages of help text.
  642.  
  643.          LABEL {ON | OFF}  (default=OFF)  --  Specify  whether  axes  with
  644.                  labels are to be displayed.
  645.  
  646.          LIST {ON | OFF}   (default=OFF)   --   Specify  whether  commands
  647.                  executed from an external file by use of the  DO  command
  648.                  are to be listed as they are executed.
  649.  
  650.          NUMPOINTS cexpr  (default=100) -- Specify the number of points at
  651.                  which the functions are to be evaluated over the  domain.
  652.                  Specifying  a  larger  number  of  points  results  in  a
  653.                  smoother plot but increases the computation  time.    The
  654.                  maximum  number  of  points that may be computed is 2000.
  655.                  This command may be abbreviated to the single letter 'N'.
  656.  
  657.          ORIGIN {ON | OFF} (default=OFF) --  Specify  whether  the  origin
  658.                  (0,0) is  to  be  forced  to be included in the plot.  If
  659.                  this option is off and the range of values does not  span
  660.                  0, then  the  origin  may not be displayed.  Turning this
  661.                  option on allows the range of the  function  relative  to
  662.                  the  origin  to  be  observed,  but may result in a small
  663.                  scale factor if the range is far from the origin.
  664.  
  665.          Pn cexpr -- Specify a value for parameter Pn where 'n' is in  the
  666.                  range 0  to  9.    MATHPLOT  allows  you to use up to ten
  667.                  parameter values  in  function   specifications.      The
  668.                  parameters are  named  P0, P1, ..., P9.  You can assign a
  669.                  new value to a parameter and replot the function  without
  670.                  having to retype the function.
  671.  
  672.               MATHPLOT -- Mathematical Function Plotter     Page 16
  673.  
  674.  
  675.          PAUSE [cexpr]  (default=0)  --  This  command  may be placed in a
  676.                  command  file  to cause execution to pause until a key is
  677.                  pressed or the specified number of seconds  elapse.    If
  678.                  cexpr is omitted or has the value 0, execution pauses for
  679.                  an indefinite time until a key is pressed.
  680.  
  681.          PDEVICE device  (default=PRN) -- Allows you to specify the device
  682.                  or file to which printer output is written when  printing
  683.                  is turned on by use of the PRINT ON command.  The default
  684.                  device  is  "PRN" but you may specify another device such
  685.                  as LPT2 or COM. You may also direct output to a disk file
  686.                  that you can printer later using the DOS  PRINT  or  COPY
  687.                  commands.
  688.  
  689.          PLOT [cexpr]   (default=0)  --  Evaluate  the  currently  defined
  690.                  functions and plot them.  If an optional value (cexpr) is
  691.                  specified, the function is displayed  for  the  specified
  692.                  number of  seconds  or  until  a  key is pressed.  If the
  693.                  optional value  is  omitted  or  is  zero,  the  plot  is
  694.                  displayed  for an indefinite time until a key is pressed.
  695.                  The use of the optional value is  most  useful  when  the
  696.                  PLOT  command occurs in a command file producing a "slide
  697.                  show" of functions.  This command may be  abbreviated  to
  698.                  the letter 'P'.
  699.  
  700.          PRINT {ON | OFF} (default=OFF) -- Turns printer output on or off.
  701.                  When  turned on, any plot displayed on the screen is also
  702.                  written to the  printer  (or  file  as  directed  by  the
  703.                  PDEVICE command).
  704.  
  705.          RESET -- Reset all parameters and options to their initial values
  706.                  and remove all function definitions.
  707.  
  708.          SAVE filename  --  Write the current function definitions and the
  709.                  values of all options and  parameters  to  the  specified
  710.                  file.  The DO command can then be used at a later time to
  711.                  redisplay the  function.    The default file extension is
  712.                  ".FUN".
  713.  
  714.          TABULATE -- Evaluate  the  functions  and  print  the  values  in
  715.                  tabular form rather than plotting them.
  716.  
  717.                MATHPLOT -- Mathematical Function Plotter     Page 17
  718.  
  719.  
  720.          TITLE string -- Define a title line to be displayed at the top of
  721.                  the plot.
  722.  
  723.          WAXES cexpr (default=3) -- Specify the width  (in  dots)  of  the
  724.                  axis lines  for  printed output.  This parameter does not
  725.                  affect the screen display.
  726.  
  727.          WFn cexpr (default=3) -- Specify the width (in dots) of the  line
  728.                  used to draw the plot of function 'n'.  This only affects
  729.                  hard copy output.
  730.  
  731.          WGRID cexpr  (default=1)  --  Specify  the width (in dots) of the
  732.                  grid lines.  This only affects hard copy output.
  733.  
  734.               MATHPLOT -- Mathematical Function Plotter     Page 18
  735.  
  736.  
  737.          ADVANCED APPLICATIONS
  738.  
  739.          Root Finding
  740.  
  741.          MATHPLOT can be used to find the roots of equations.  To do this,
  742.          turn  on  axis labeling (LABEL ON) and plot the function over the
  743.          domain in which a root occurs.  Observe the approximate  X  value
  744.          at  which  the  function  crosses  the  X axis and then reset the
  745.          domain to closely span the crossing point.  Replot  the  function
  746.          and obtain  a  new X estimate.  After several iterations you will
  747.          be able to determine the root to several significant digits.  For
  748.          example, use this technique to find the root of the function:
  749.  
  750.          Y = X^4 - EXP(X)
  751.  
  752.          in the domain (2,9.5).
  753.  
  754.          For a course in Algebra I, MATHPLOT can be  used  to  demonstrate
  755.          the graphical method of solving two simultaneous linear equations
  756.          by locating the point of intersection.  For an Algebra II course,
  757.          MATHPLOT  can  be  used  to locate minimum and maximum points for
  758.          quadratic and cubic equations.
  759.  
  760.          Multiple Domains
  761.  
  762.          MATHPLOT only allows specification of a single continuous  domain
  763.          of values.    However,  by  using  the multiple function plotting
  764.          capability it is sometimes possible to simulate multiple domains.
  765.          For example, the function X*Y=5 defines a hyperbola with branches
  766.          in both the positive X-Y domain (upper right  quadrant)  and  the
  767.          negative X-Y  domain (lower left quadrant).  The following set of
  768.          commands defines two parametric functions to  draw  each  of  the
  769.          branches:
  770.  
  771.          X1=T
  772.          Y1=5/T
  773.          X2=-T
  774.          Y2=-5/T
  775.          DOMAIN 0.5,10
  776.          LABEL ON
  777.          COMMONSCALE ON
  778.          PLOT
  779.  
  780.                MATHPLOT -- Mathematical Function Plotter     Page 19
  781.  
  782.  
  783.          Interesting Functions
  784.  
  785.          The following  specifications  plot  interesting  and  attractive
  786.          functions:
  787.  
  788.          TITLE Four Leaved Rose
  789.          CTITLE 4
  790.          R=2*SIN(2*A)
  791.          CF1 3
  792.          DOMAIN 0,2*PI
  793.          NUMPOINTS 150
  794.          AXES ON
  795.          CAXES 1
  796.          PLOT
  797.  
  798.          TITLE Prolate Cycloid
  799.          CTITLE 4
  800.          Y=1-2*COS(T)
  801.          X=T-2*SIN(T)
  802.          CF1 2
  803.          DOMAIN -4*PI,4*PI
  804.          NUMPOINTS 400
  805.          CAXES 1
  806.          COMMONSCALE ON
  807.          PLOT
  808.  
  809.          TITLE Hypocycloid of four cusps (Asteroid)
  810.          CTITLE 4
  811.          Y=SIN(T)^3
  812.          X=COS(T)^3
  813.          CF1 2
  814.          DOMAIN 0,2*PI
  815.          NUMPOINTS 100
  816.          AXES ON
  817.          CAXES 1
  818.          COMMONSCALE ON
  819.          PLOT
  820.  
  821.                MATHPLOT -- Mathematical Function Plotter     Page 20
  822.  
  823.  
  824.          TITLE Bifolium
  825.          CTITLE 4
  826.          Y=2*SIN(T)^2*COS(T)^2
  827.          X=2*SIN(T)*COS(T)^3
  828.          CF1 3
  829.          DOMAIN 0,2*PI
  830.          NUMPOINTS 100
  831.          AXES ON
  832.          CAXES 1
  833.          COMMONSCALE ON
  834.          PLOT
  835.  
  836.          TITLE Epicycloid
  837.          CTITLE 4
  838.          Y=5*SIN(T)-SIN(5*T)
  839.          X=5*COS(T)-COS(5*T)
  840.          CF1 3
  841.          DOMAIN 0,2*PI
  842.          NUMPOINTS 150
  843.          AXES ON
  844.          CAXES 1
  845.          COMMONSCALE ON
  846.          PLOT
  847.  
  848.          "Artistic" Plots
  849.  
  850.          When MATHPLOT plots a function, it evaluates the function at  the
  851.          number of points specified by the last NUMPOINTS command and then
  852.          connects the points together using straight lines.  By specifying
  853.          very  large  domain values for polar or parametric functions, the
  854.          lines connecting the points  span  large  distances  and  produce
  855.          interesting and  "artistic"  plots.   It is best to turn off axis
  856.          display  (AXES OFF,  LABELS OFF)  and  turn  on  common   scaling
  857.          (COMMONSCALE ON) for these plots.  Here are some examples to try:
  858.  
  859.          Y=SIN(T)^3
  860.          X=COS(T)^3
  861.          CF1 2
  862.          DOMAIN 0,4000
  863.          NUMPOINTS 500
  864.  
  865.                MATHPLOT -- Mathematical Function Plotter     Page 21
  866.  
  867.  
  868.          R=2*SIN(2*A)
  869.          CF1 3
  870.          DOMAIN 0,2000
  871.          NUMPOINTS 500
  872.  
  873.          Y=5*SIN(T)-SIN(5*T)
  874.          X=5*COS(T)-COS(5*T)
  875.          CF1 3
  876.          DOMAIN 0,6000
  877.          NUMPOINTS 400
  878.  
  879.          Parametric and polar functions seem to produce the best  artistic
  880.          plots.   By  varying  the  NUMPOINTS  and  DOMAIN  values you can
  881.          usually produce many different plots from the same functions.
  882.  
  883.               MATHPLOT -- Mathematical Function Plotter     Page 22
  884.  
  885.  
  886.          USE AND DISTRIBUTION OF MATHPLOT
  887.  
  888.          MATHPLOT is  a  "shareware"  product.    You  are welcome to make
  889.          copies of this program and pass them on to friends or  post  this
  890.          program on bulletin boards.
  891.  
  892.          However,  if  you  find MATHPLOT to be useful and/or entertaining
  893.          you are expected to send to  the  author  the  registration  form
  894.          printed  on  the next page with $20 to help cover the development
  895.          and support of MATHPLOT. In return, you  will  receive  the  most
  896.          recent  version  of  the  program and a bound copy of the manual.
  897.          Add $5 if Mathplot is being shipped out of the United States.
  898.  
  899.          See also the special offer with Nonlin that follows.
  900.  
  901.          You are welcome to write to the author at:
  902.  
  903.                              Phillip H. Sherrod
  904.                              4410 Gerald Place
  905.                              Nashville, TN  37205-3806
  906.  
  907.          Both the MATHPLOT program and  documentation  are  copyright  (c)
  908.          1991-1992 by  Phillip  H.  Sherrod.    You  are not authorized to
  909.          modify the program. "MATHPLOT" is a trademark.
  910.  
  911.          Disclaimer
  912.  
  913.          MATHPLOT is provided "as is" without warranty of any kind, either
  914.          expressed or implied.    This  program  may  contain  "bugs"  and
  915.          inaccuracies, and its results should not be assumed to be correct
  916.          unless they  are  verified  by  independent  means.    The author
  917.          assumes no responsibility for the use of MATHPLOT and will not be
  918.          responsible for any damage resulting from its use.
  919.  
  920.               MATHPLOT -- Mathematical Function Plotter     Page 23
  921.  
  922.  
  923.                                     N O N L I N
  924.  
  925.               Nonlinear Regression Analysis Program -- Special Offer
  926.  
  927.          If  you  like  Mathplot,  you  should  check  out  Nonlin  -- the
  928.          nonlinear regression analysis program by the same author.    And,
  929.          if you register your use of Mathplot and order Nonlin at the same
  930.          time, you can get both for the special price of $36.
  931.  
  932.          What is   regression   analysis?      Regression  analysis  is  a
  933.          mathematical  technique  for  determining  the  best  values   of
  934.          parameters to  fit  an  equation  to  a  set of data points.  For
  935.          example, you might want to develop an equation of the form
  936.  
  937.          price = p0 + p1*age + p2*miles
  938.  
  939.          to predict the price of a used car  based  on  its  age  and  the
  940.          number of  miles  driven.   With Nonlin you can collect data from
  941.          car ads and then perform the analysis using the following set  of
  942.          commands:
  943.  
  944.              VARIABLES PRICE,AGE,MILES
  945.              PARAMETERS P0,P1,P2
  946.              FUNCTION  PRICE = P0 + P1*AGE + P2*MILES
  947.              DATA
  948.  
  949.          Nonlin will analyze the data and determine the best values of the
  950.          parameters P0, P1, and P2 to fit the data values.
  951.  
  952.          Ordinary  linear regression programs can only determine parameter
  953.          values for linear (straight line)  equations.    Nonlin,  on  the
  954.          other  hand,  can  handle  multivariate,  linear, polynomial, and
  955.          general nonlinear equations.  For example, using Nonlin  you  can
  956.          easily  determine  the  best  values  for  the parameters Offset,
  957.          Amplitude, and Frequency for an equation of the form:
  958.  
  959.          Y = Offset + Amplitude * sin(Frequency * X)
  960.  
  961.          Nonlin uses the same expression evaluator as Mathplot so you  can
  962.          model  complicated  equations using the full set of operators and
  963.          library functions available in Mathplot.
  964.  
  965.          If you do any data analysis, or would just like  to  learn  about
  966.          the  incredibly  useful  regression  analysis technique, you need
  967.          Nonlin!
  968.  
  969.               MATHPLOT -- Mathematical Function Plotter     Page 24
  970.  
  971.  
  972.        =====================================================================
  973.                                 Software Order Form
  974.        =====================================================================
  975.  
  976.          NAME ______________________________________________________
  977.  
  978.          ADDRESS ___________________________________________________
  979.  
  980.          CITY _______________________  STATE _______ ZIP ___________
  981.  
  982.          TELEPHONE _________________________________________________
  983.  
  984.          COMPUSERVE ACCOUNT (optional) _____________________________
  985.  
  986.          MATHPLOT VERSION (on title screen) ________________________
  987.  
  988.          BULLETIN BOARD WHERE YOU FOUND MATHPLOT ___________________
  989.  
  990.          COMMENTS __________________________________________________
  991.  
  992.  
  993.          Check the box below which indicates your order type:
  994.  
  995.          ___ I wish to register Mathplot ($20).
  996.  
  997.          ___ I wish to order Nonlin ($20).
  998.  
  999.          ___ I wish to register Mathplot and order Nonlin ($36).
  1000.  
  1001.          Add $5 to any amount shown above if the software is being shipped
  1002.          out of the United States.
  1003.  
  1004.          Distribution disk choice (check one):
  1005.  
  1006.                3.50" HD (1.4 MB)  ______
  1007.                5.25" HD (1.2 MB)  ______
  1008.                5.25" DD (360 KB)  ______
  1009.  
  1010.          Send this form with the amount indicated to the author at:
  1011.  
  1012.                                 Phillip H. Sherrod
  1013.                                  4410 Gerald Place
  1014.                              Nashville, TN  37205-3806
  1015.